package com.linghu.tools;

import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

@Component
public class HttpTools {
    @Tool("获取指定URL的发起Get类型请求，返回String类型的响应体")
    public String send(@P("URL地址") String url){
        System.out.println("获取指定URL的发起Get类型请求："+url);
        return new RestTemplate().getForObject(url,String.class);
    }
}
